package problem509;

//509.斐波那契数
//https://leetcode.cn/problems/fibonacci-number/

class Solution {
    int[] dp = new int[35];
    public int fib(int n) {
        if(n == 0) return 0;
        if(n == 1) return 1;
        if(dp[n] != 0) return dp[n];
        dp[n] = fib(n-1) + fib(n-2);
        return dp[n];
    }
}